package com.fenghuajueli.module_host

import android.os.Bundle
import com.fenghuajueli.libbasecoreui.baseswitch.SwitchKeyV3Helper
import com.fenghuajueli.libbasecoreui.mvp.BaseActivity
import com.fenghuajueli.libbasecoreui.user.UserInfoUtils
import com.fenghuajueli.module_user.utils.UserModuleInitUtils
import com.sy.module_ad_switch_manager.AdShowHelper
import com.sy.module_ad_switch_manager.AdSwitchManger

/**
 * @Author: sz_ijj
 * @Date: 2024-01-06 14:34
 **/
open class BaseMainActivity : BaseActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        AdSwitchManger.preloadAds(this)
        AdSwitchManger.showSplashEye(this)
        UserModuleInitUtils.updateUserInfoByToken()
        checkAppUpdate()
    }
    override fun onResume() {
        super.onResume()
        val vipState = UserInfoUtils.getInstance().isVip()
        val adSwitch = SwitchKeyV3Helper.getAdSwitch()
        AdShowHelper.showInsertAd(vipState, adSwitch, this, "NewInteractionAdTag", null)
    }
}